Closed
Conversation
The ultimate goal of this commit was to move the handling of loading files via drag-and-drop out of the handleMsg switch case and into its own function. Once it was in its own function I made the function more robust. I also noticed a frequent crash was due to a race condition between the destruction of WideString and the DragFinish call. Scoping the loop that contains WideString guarantees this race condition can't occur. Resolve a crash caused by really long path names https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation Update System.cpp Update System.cpp
Owner
|
I think my commit to #108 fixes this. Can you test/confirm? |
Collaborator
Author
It does seem to, so I'll close this and you can merge 108 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since drag-n-drop loading seems to still be in a fragile state I made some new improvements for file loading.
First, the drag-n-drop loading logic is taken out of the
handleMsgswitch case and moved into its own functionhandleFileDrop.The function is then expanded with extra safeties to try and prevent crashes due to a race condition, or crashes due to really long paths to the files.
Btw, MP3 is more prone to crashing when randomly dragging and dropping files than OGG is. This PR makes MP3 loading a lot less prone to crashing the app, but this doesn't completely 100% resolve weird behavior with specifically loading MP3 this way. I haven't looked into the LoadMp3 code yet, so I'll check it later to see if there's something we can be doing better.